package com.checkoutcheckins.client.data.foursquare;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.google.gson.annotations.Expose;

public class FoursquareCheckins implements Serializable {

	private static final long serialVersionUID = 8720530139663198458L;

	@Expose(deserialize = false)
	private List<Checkin> checkins = new ArrayList<Checkin>();

	@Expose(deserialize = false)
	private List<Checkin> venueCheckins = new ArrayList<Checkin>();

	@Expose(deserialize = false)
	private List<Checkin> geolocatedCheckins = new ArrayList<Checkin>();

	public void addCheckins(List<Checkin> checkins) {
		this.checkins.addAll(checkins);
	}

	public void setCheckins(List<Checkin> checkins) {
		this.checkins = checkins;
	}

	public List<Checkin> getCheckins() {
		return checkins;
	}

	public List<Checkin> getVenueCheckins() {

		for (Checkin checkin : checkins) {
			if (checkin.getVenue() != null) {
				venueCheckins.add(checkin);
			}
		}
		return venueCheckins;
	}

	public List<Checkin> getGeolocatedCheckins() {

		getVenueCheckins();

		for (Checkin checkin : venueCheckins) {
			if (checkin.getVenue().getGeolat() != null
					&& checkin.getVenue().getGeolong() != null) {
				geolocatedCheckins.add(checkin);
			}
		}

		return geolocatedCheckins;
	}
}
